
<style type="text/css">
.gallery {
	list-style: none;
	margin: 0;
	padding: 0;
}
.gallery li {
	padding: 10px;
	margin: 0;
	float: left;
	position: relative;
	width: 180px;
	height: 130px;
}
.gallery li:hover img {
	border-color: #000;
}
.gallery img {
	background: #fff;
	border: solid 1px #888;
	padding: 5px;
}
.gallery em {
	background: #fff url(<?php echo Configure::read('cmsConfig.Backend.siteUrl');?>/assets/img/grey-gradient.gif) repeat-y;
	color: #000;
	font-style: normal;
	padding: 2px 10px;
	display: block;
	position: absolute;
	top: 110px;
	left: 9px;
	border: 1px solid #999;
	border-left-color: #888;
}
.gallery a {
	text-decoration: none;
}
.gallery a:hover em {
	background: #ffdb01 url(<?php echo Configure::read('cmsConfig.Backend.siteUrl');?>/assets/img/orange-gradient.gif) repeat-y;
	border-color: #c25b08;
}
</style>

<?php
// hack for this gallery view
if(isset($imgOptions['clickable']))
{
	unset($imgOptions['clickable']);
}
?>
<ul class="gallery">
<?php foreach($galleryItems as $galleryItem) { ?>
	<?php
	if(!is_array($galleryItem) && !isset($galleryItem['Asset']))
	{
		$galleryItem = array('Asset'=>$galleryItem);
	}
	if(strlen($galleryItem['Asset']) < 1)
		continue;
	// hack for this gallery view
	$mediaLink = $html->url('/media/'.$galleryItem['Asset']['id']);
	?>
	<li><a href="<?php echo $mediaLink;?>"><em><?php echo $galleryItem['Asset']['commentCount'];?> comments</em><?php echo $asset->preview($galleryItem, null, $imgOptions);?></a></li>
<?php } ?>
</ul>